import request from './request';

// 获取所有标签
export function getTagList() {
    return request({
        url: '/tag',
        method: 'get',
    });
}

// 根据ID获取标签详情
export function getTagById(id) {
    return request({
        url: `/tag/${id}`,
        method: 'get',
    });
}

// 创建标签
export function addTag(data) {
    return request({
        url: '/tag',
        method: 'post',
        data,
    });
}

// 更新标签
export function editTag(data) {
    return request({
        url: `/tag/${data.id}`,
        method: 'put',
        data,
    });
}

// 删除标签
export function deleteTag(id) {
    return request({
        url: `/tag/${id}`,
        method: 'delete',
    });
}
